<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="insn.css"/><meta name="generator" content="iform.xsl"/><title>HVC -- A64</title></head><body><table style="margin: 0 auto;"><tr><td><div class="topbar"><a href="index.html">Base Instructions</a></div></td><td><div class="topbar"><a href="fpsimdindex.html">SIMD&amp;FP Instructions</a></div></td><td><div class="topbar"><a href="sveindex.html">SVE Instructions</a></div></td><td><div class="topbar"><a href="mortlachindex.html">SME Instructions</a></div></td><td><div class="topbar"><a href="encodingindex.html">Index by Encoding</a></div></td><td><div class="topbar"><a href="shared_pseudocode.html">Shared Pseudocode</a></div></td><td><div class="topbar"><a href="notice.html">Proprietary Notice</a></div></td></tr></table><hr/><h2 class="instruction-section">HVC</h2>
      <p class="aml">Hypervisor Call causes an exception to EL2. Software executing at EL1 can use this instruction to call the hypervisor to request a service.</p>
      <p class="aml">The <span class="asm-code">HVC</span> instruction is <span class="arm-defined-word">undefined</span>:</p>
      <ul>
        <li>When EL3 is implemented and <a class="armarm-xref" title="Reference to Armv8 ARM section">SCR_EL3</a>.HCE is set to 0.</li>
        <li>When EL3 is not implemented and <a class="armarm-xref" title="Reference to Armv8 ARM section">HCR_EL2</a>.HCD is set to 1.</li>
        <li>When EL2 is not implemented.</li>
        <li>At EL1 if EL2 is not enabled in the current Security state.</li>
        <li>At EL0.</li>
      </ul>
      <p class="aml">On executing an <span class="asm-code">HVC</span> instruction, the PE records the exception as a Hypervisor Call exception in <a class="armarm-xref" title="Reference to Armv8 ARM section">ESR_ELx</a>, using the EC value 0x16, and the value of the immediate argument.</p>
    
    <p class="desc"/><div class="regdiagram-32"><table class="regdiagram"><thead><tr><td>31</td><td>30</td><td>29</td><td>28</td><td>27</td><td>26</td><td>25</td><td>24</td><td>23</td><td>22</td><td>21</td><td>20</td><td>19</td><td>18</td><td>17</td><td>16</td><td>15</td><td>14</td><td>13</td><td>12</td><td>11</td><td>10</td><td>9</td><td>8</td><td>7</td><td>6</td><td>5</td><td>4</td><td>3</td><td>2</td><td>1</td><td>0</td></tr></thead><tbody><tr class="firstrow"><td class="l">1</td><td>1</td><td>0</td><td>1</td><td>0</td><td>1</td><td>0</td><td class="r">0</td><td class="l">0</td><td>0</td><td class="r">0</td><td colspan="16" class="lr">imm16</td><td class="l">0</td><td>0</td><td class="r">0</td><td class="l">1</td><td class="r">0</td></tr></tbody></table></div><div class="encoding"><h4 class="encoding"/><a id="HVC_EX_exception"/><p class="asm-code">HVC  #<a href="#sa_imm" title="16-bit unsigned immediate [0-65535] (field &quot;imm16&quot;)">&lt;imm&gt;</a></p></div><p class="pseudocode">// Empty.</p>
  <div class="encoding-notes"/><h3 class="explanations">Assembler Symbols</h3><div class="explanations"><table><col class="asyn-l"/><col class="asyn-r"/><tr><td>&lt;imm&gt;</td><td><a id="sa_imm"/>
        
          <p class="aml">Is a 16-bit unsigned immediate, in the range 0 to 65535, encoded in the "imm16" field.</p>
        
      </td></tr></table></div><div class="syntax-notes"/>
    <div class="ps"><a id="execute"/><h3 class="pseudocode">Operation</h3>
      <p class="pseudocode">if !<a href="shared_pseudocode.html#impl-shared.HaveEL.1" title="function: boolean HaveEL(bits(2) el)">HaveEL</a>(<a href="shared_pseudocode.html#EL2" title="constant bits(2) EL2 = '10'">EL2</a>) || PSTATE.EL == <a href="shared_pseudocode.html#EL0" title="constant bits(2) EL0 = '00'">EL0</a> || (PSTATE.EL == <a href="shared_pseudocode.html#EL1" title="constant bits(2) EL1 = '01'">EL1</a> &amp;&amp; !<a href="shared_pseudocode.html#impl-shared.EL2Enabled.0" title="function: boolean EL2Enabled()">EL2Enabled</a>()) then
    UNDEFINED;

bits(1) hvc_enable = if <a href="shared_pseudocode.html#impl-shared.HaveEL.1" title="function: boolean HaveEL(bits(2) el)">HaveEL</a>(<a href="shared_pseudocode.html#EL3" title="constant bits(2) EL3 = '11'">EL3</a>) then SCR_EL3.HCE else NOT(HCR_EL2.HCD);

if hvc_enable == '0' then
    UNDEFINED;
else
    <a href="shared_pseudocode.html#AArch64.CallHypervisor.1" title="function: AArch64.CallHypervisor(bits(16) immediate)">AArch64.CallHypervisor</a>(imm16);</p>
    </div>
  <hr/><table style="margin: 0 auto;"><tr><td><div class="topbar"><a href="index.html">Base Instructions</a></div></td><td><div class="topbar"><a href="fpsimdindex.html">SIMD&amp;FP Instructions</a></div></td><td><div class="topbar"><a href="sveindex.html">SVE Instructions</a></div></td><td><div class="topbar"><a href="mortlachindex.html">SME Instructions</a></div></td><td><div class="topbar"><a href="encodingindex.html">Index by Encoding</a></div></td><td><div class="topbar"><a href="shared_pseudocode.html">Shared Pseudocode</a></div></td><td><div class="topbar"><a href="notice.html">Proprietary Notice</a></div></td></tr></table><p class="versions">
      Internal version only: isa v33.62, AdvSIMD v29.12, pseudocode v2023-03_rel, sve v2023-03_rc3b
      ; Build timestamp: 2023-03-31T11:36
    </p><p class="copyconf">
      Copyright © 2010-2023 Arm Limited or its affiliates. All rights reserved.
      This document is Non-Confidential.
    </p></body></html>
